from fastapi import APIRouter
from intelli_port.announcements import get_system_announcements, refresh_from_config


router = APIRouter()


@router.get("/list")
async def list_announcements():
    return get_system_announcements()


@router.post("/refresh")
async def refresh():
    refresh_from_config()
    return get_system_announcements()